package org.example.skytool.commom;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import org.springframework.stereotype.Component;

/**
 * @author GYF
 */
//雪花算法代码实现
@Component
public class IdWorker {

    private Snowflake secondSnow;

    public IdWorker(){
        secondSnow = IdUtil.getSnowflake(1,1);
    }

    public Long nextId(){
        return secondSnow.nextId();
    }

}
